<?php

class Newsletter_model extends CI_Model {
    
    function Newsletter_model() {
        $this->load->library('api/services/Newsletter');
    }
    
    function newsletter_get($newsletter_id) {
        $data = Newsletter::newsletterGet($newsletter_id);
        
        if(!empty($data)) return $data;
        else return false;
    }
    
    function newsletter_set($language_id, $name, $cover, $content) {
        return Newsletter::newsletterSet($language_id, $name, $cover, $content);
    }
    
    function newsletter_update($newsletter_id, $language_id, $name, $cover, $content) {
        return Newsletter::newsletterUpdate($newsletter_id, $language_id, $name, $cover, $content);
    }
    
    function newsletter_delete($newsletter_id) {
        return Newsletter::newsletterDelete($newsletter_id);
    }
    
    function newsletters_list($language_id) {
        $data = Newsletter::newslettersList($language_id);
        
        if(!empty($data)) return $data;
        else return false;   
    }
    
    function newsletter_subscribe($email) {
        return Newsletter::newsletterSubscribe($email);
    }
    
    function newsletter_unsubscribe($email) {
        return Newsletter::unnewsletterSubscribe($email);
    }
    
    function newsletter_subscribers_list() {
        $data = Newsletter::newsletterSubscribersList();
        
        if(!empty($data)) return $data;
        else return false;   
    }
    
}

?>